package com.sl.water.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sl.water.dao.PlanECunPersonDao;
import com.sl.water.entity.PlanECunPerson;
import com.sl.water.service.PlanECunPersonService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:
 * @author: duan
 * @time: 2025-06-30 14:31
 */
@Service
@RequiredArgsConstructor
public class PlanECunPersonServiceImpl extends ServiceImpl<PlanECunPersonDao, PlanECunPerson> implements PlanECunPersonService {
    @Override
    public List<PlanECunPerson> getPersonList(String cun, String kind) {
        LambdaQueryWrapper<PlanECunPerson> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotEmpty(cun)) {
            lambdaQueryWrapper.eq(PlanECunPerson::getCun, cun);
        }
        if (StringUtils.isNotEmpty(kind)) {
            lambdaQueryWrapper.eq(PlanECunPerson::getKind, kind);
        }
        return this.list(lambdaQueryWrapper);
    }
}
